function process_datalogger_logfiles(log_directory, output_directory)
% DATALOGGER - Process log files from log_directory and generates
%   *.mat files in output_directory.
%
%   DL/YYYY_MM_DD_no00.txt => YYMMDD_DL.mat
%
% Usage:
%   values=parse_logfile('100129.A.LOG');
%

%% cleaning

%% processing files
id = 'DL';
files_dir = strcat(log_directory, '/', id);
disp(['Processing device:', files_dir]);
files = dir(strcat(files_dir, '/*.txt'));
nfiles = size(files,1);
for j=1:nfiles
	filename = files(j).name;
    file_fullname = strcat(files_dir,'/', filename);
    disp(['Parsing ...:', file_fullname]);
    values=parse_datalogger_logfile(file_fullname);
    matfile_fullname = strcat(output_directory,'/', filename, '_', id, '.mat');
    disp(['converted to:', matfile_fullname]);
    save(matfile_fullname, 'values');
end
